//
//  UITextView+HWPlaceholder.m
//  嗨文
//
//  Created by 响当当 on 2019/1/18.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import "UITextView+HWPlaceholder.h"

@implementation UITextView (HWPlaceholder)

- (void)setPlaceHolder:(NSString *)placeHolder {
    UILabel *placeHolderStr = [[UILabel alloc] init];
    placeHolderStr.text = placeHolder;
    placeHolderStr.numberOfLines = 0;
    placeHolderStr.textColor = [UIColor lightGrayColor];
    [placeHolderStr sizeToFit];
    [self addSubview:placeHolderStr];
    placeHolderStr.font = self.font;
    [self setValue:placeHolderStr forKey:@"_placeholderLabel"];
}
@end
